package main

import (
	"bootstrap"
	"center_server/gateway"
	. "center_server/internal"
	"center_server/logic"
	"flag"
	"leaf"
)

// init
import (
	_ "center_server/logic/launcher"
)

var (
	configPath string
)

func init() {
	flag.StringVar(&configPath, "config", "center_server.json", "game center internal file path")
}

func main() {
	flag.Parse()
	Config.Init(configPath)

	defer bootstrap.Close()
	args := new(bootstrap.StartArgs)
	args.Config = &Config.Bootstrap
	bootstrap.Start(args)

	leaf.Run(
		&Config.Leaf,
		logic.Module,
		gateway.Module,
	)
}
